<!DOCTYPE html>
<title>Slow loading WebVTT file interrupted just after a cue text linebreak.</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
async_test(function(t) {
    var video = document.createElement("video");
    var track = document.createElement("track");
    video.appendChild(track);

    track.onload = t.step_func_done(function() {
        assert_equals(track.track.cues.length, 2);
        assert_equals(track.track.cues[0].text, "Lorem\u000aipsum");
    });

    track.onerror = t.unreached_func();

    var loadAndStallUrl = "http://127.0.0.1:8000/resources/load-and-stall.php";
    var vttTrackUrl = "?name=../../../media/track/captions-webvtt/captions-multiline-lf.vtt&mimeType=text%2Fvtt";
    track.src = loadAndStallUrl + vttTrackUrl + "&stallAt=49&stallFor=1";
    track.track.mode = "hidden";
});
</script>